﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Product.Master" Inherits="System.Web.Mvc.ViewPage<SDT.Site.ViewModels.ProductSearchModels>" %>
<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<%@ Import Namespace="SDT.Lib.Helpers" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	 <%=Html.Encode(Model.PathTitle) %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="content">
    
    <form action="/product/list" name="siteForm" id="siteForm" method="post">
    <div id="product-tabs">
        <div class="tit_bds_canban">
            <%=Html.Encode(Model.PathTitle) %>
        </div>
        <div class="line" style="border-bottom: 2px solid #999; margin-bottom:0px"></div>    
        <div class="clear"></div>          
        <div class="list_cate_1 product-detail">
            <ul>
                <% if (Model.Products != null && Model.Products.Count() > 0)
                   {
                       foreach (var item in Model.Products)
                       {
                %>
                <li class="line_dot line_vip line_vip3">
                    <div class="prd_tt_img">
                        <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
                            <% string imgPath = (item.ImagePath != null && item.ImagePath != string.Empty) ? SDT.Lib.Common.Utils.GenThumbnail(item.ID, 82, 63, item.ImagePath, Model.ImagePath, Model.ImageUrl) : SDT.Lib.Common.Globals.DefaultLogo; %>
                            <img src="<%=imgPath %>" title="" alt="<%=item.Title %>" width="82" height="63" class="bor_img" />
                        </a>
                    </div>
                    <div class="tt_txt_tinrao">
                       <h3>
                            <a href="/product/details/<%=item.ID %>/<%=Html.ToUrlFriendly(item.Title)%>">
                                <%=Html.Encode(item.Title) %>
                            </a>
                            <%--<%=Html.ActionLink(item.Title, "Details", "Product",new{id=item.ID}, null)%> --%>
                       </h3>
                        <div><%=Html.Encode(item.Summary.Length>150? item.Summary.Substring(0,150)+"...":item.Summary) %></div>
                    </div>
                    <div class="clear"></div>
                    <div class="info">
            	        <div style="float: left">Giá: <span class="t_org"><%=item.Cost != null && item.Cost > 0 ? SDT.Lib.Common.Utils.ReadNumber((double)item.Cost) +"&nbsp;" + (item.CurrencyID.HasValue && item.CurrencyID.Value == SDT.Lib.Common.CurrencyType.USD ? "USD" : string.Empty) + item.UnitCost : "Thỏa thuận"%></span>
                	        Diện tích: <span class="t_org"><%=item.Area %>m&sup2;</span>
                            Quận/Huyện: <span class="t_org"><%=Html.Encode(item.District.Name) %>,&nbsp;
                                                <%=Html.Encode(item.City.Name) %></span>
                        </div>
                        <div style="float: right"><%=item.AddDate.Value.ToString("dd/MM/yyyy") %></div>
                        <div class="clear"></div>
                    </div>                    
                </li>
                <%}
                   }%>
            </ul>
        </div>
        
    </div>
    <div class="clear">&nbsp;</div>
        <div class="pagebarUTH f_r">
            Trang <%= Model.Products.PageNumber%>/<%= Model.Products.PageCount%>
            <%= Html.Pager(Model.Products.PageSize, Model.Products.PageNumber, Model.Products.TotalItemCount, new
                    {
                        id = Model.TypeID,
                        catid = Model.CategoryID,
                        cityid = Model.CityID,
                        distrid = Model.DistrictID,
                        areaid = Model.AreaID,
                        priceid = Model.PriceID,
                        projectid = Model.ProjectID,
                        timeid = Model.TimeID,
                        pageSize = Model.Products.PageSize,                        
                        key = Model.Keyword
                    })%>
         </div>	
    </form>
</div>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="LeftContent" runat="server">
<% Html.RenderPartial("~/Views/Product/Left.ascx", Model); %>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="RightContent" runat="server">
    <% Html.RenderPartial("~/Views/Product/SearchSmall.ascx", Model); %>
    <%--<div class="clear"></div>
    <% Html.RenderPartial("~/Views/Product/PostSmall.ascx"); %>--%>
    <div class="clear"></div>
    <% Html.RenderAction("Hot", "Project", new { number = 3, catid = 0, hotYN = 1, pubYN = 1, title = "Dự án nổi bật", prjorder = "ID", prjorderDir = "desc" }); %>
    <%--<div class="clear"></div>
    <% Html.RenderAction("LastedSmall", "Useful", new { number = 8 }); %>--%>
    <div class="clear"></div>
    <% Html.RenderAction("LastedSmall", "Event", new { number = 5, catid = 0 }); %>
    <div class="clear"></div>
    <% Html.RenderAction("Guide", "Article", new { number = 5, skip = 0, catid = SDT.Model.ConfigManager.GetCamnangMuaban(), title = "Cẩm nang mua bán", aorder = "ID", aorderDir = "desc" }); %>
    <div class="clear"></div>
    <% Html.RenderAction("Guide", "Article", new { number = 5, skip = 0, catid = SDT.Model.ConfigManager.GetCamnangNhadautu(), title = "Cẩm nang nhà đầu tư", aorder = "ID", aorderDir = "desc" }); %>
     <div class="clear"></div>
    <% Html.RenderAction("Guide", "Article", new { number = 5, skip = 0, catid = SDT.Model.ConfigManager.GetCamnangMoigioi(), title = "Cẩm nang nhà môi giới", aorder = "ID", aorderDir = "desc" }); %>
</asp:Content>
